import { ModelInfo } from "../../scene/player/info/ModelInfo";
import { TItemMount } from "../../../../Message/Db/Tables/TItemMount";
import { TItemWeapon } from "../../../../Message/Db/Tables/TItemWeapon";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../ColorConfig";
import { TItem } from "../../../../Message/Db/Tables/TItem";
type int = number;
//class ItemInfo
    
    export  class ItemInfo extends ModelInfo
    {
       

        public get url(): string
        {
            return this.item.icon + ".jpg";
        }

        public getExtendAtt(arg1: string)
        {
            return this.extend[arg1];
        }

        public /* override */ get modelId(): string
        {
            if (typeof this.extend === "titemmount") 
            {
                return (this.extend as TItemMount).modelId;
            }
            if (typeof this.extend === "titemweapon") 
            {
                return (this.extend as TItemWeapon).modelId;
            }
            return "";
        }

        public get type(): int
        {
            if (typeof this.extend === "titemmount") 
            {
                return (this.extend as TItemMount).type;
            }
            if (typeof this.extend === "titemweapon") 
            {
                return (this.extend as TItemWeapon).type;
            }
            return -1;
        }

        public get normalTooltip(): string
        {
            return "";
        }

        public get tooltip1(): string
        {
            return "";
        }

        public get tooltip2(): string
        {
            return "";
        }

        public get htmlName(): string
        {
            return HTMLUtil.addColor(this.item.name, this.colorStr);
        }

        public get colorStr(): string
        {
            return ColorConfig.instance.getItemColorString(this.item.color);
        }

        public /* var */item: TItem;

        public /* var */extend: Object;
    }
